package cn.lijiajia3515.cairo.auth.domain.mongo;

import cn.lijiajia3515.cairo.mongo.data.AbstractMongo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;

import java.time.LocalDateTime;

/**
 * 账号 互联 信息
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)

@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder(toBuilder = true)
public class ConnectionMongo extends AbstractMongo {
	@Id
	private ObjectId _id;
	/**
	 * 互联提供商
	 */
	private String connection;

	/**
	 * 唯一标识
	 * openid/uid/subject
	 */
	private String subject;

	/**
	 * cairo account
	 */
	private String account;

	/**
	 * 互联时 用户信息
	 */
	private Object info;

	/**
	 * mongo 字段
	 */
	public static final Field FIELD = new Field();

	public static class Field extends AbstractMongo.Field {
		public Field() {
			super();
		}

		public Field(AbstractMongo.Field parent, String prefix) {
			super(parent, prefix);
		}

		public final String CONNECTION = field("Connection");
		public final String SUBJECT = field("Subject");

		public final String ACCOUNT = field("Account");

		public final String INFO = field("Info");
	}
}
